home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6487 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: s02.pavilion.co.uk!usenet
  2. From: AJRobb@pavilion.co.uk (Andy J Robb)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: [Q] Does free() work?
  5. Date: Sat, 24 Feb 1996 23:05:00 GMT
  6. Organization: Pavilion Internet plc
  7. Message-ID: <4go5h0$sql@s02.pavilion.co.uk>
  8. References: <4gm3ss$qfa@news.infoserve.net>
  9. NNTP-Posting-Host: poolc50.pavilion.co.uk
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. yang@unix.infoserve.net (Sung Moo Yang) wrote:
  13.  
  14. >Question on the function free() in MSC 5.1 running on MS-DOS 6.0 on 486 DX2.
  15.  
  16. >The library function free() doesn't free memory allocated however _dos_freemem() does.
  17. >Example TEST.C uses free() to release memory while TEST2.C uses _dos_freemem() to do so. Result screen was followed respectively.
  18.  
  19. >Why doesn't free() release the memory allocated? 
  20. >Thanks in advance.
  21.  
  22. Once memory has been grabbed for the heap it is usually retained.
  23. However, free() does allow the memory to be re-used by malloc().
  24.  
  25. Regards,
  26. Andy Robb.
  27. -----BEGIN PGP PUBLIC KEY BLOCK-----
  28. Version: 2.6.2i
  29.  
  30. mQCNAy/MpRwAAAEEAOt6uBYqT8yv9EmqNhK8m6v+bYi8QjnGW3Bo6iU1gsMj5pa6
  31. MHgq99c8deADbE3cbJ6uZS9v5pZE3WCf6HCQjlB5iULA5RZzMdAumd/WUzuL9UT3
  32. B44D9EqqFIL79FlYb56v4oKFqFp1/J2bIpYUwnUvabGzGjdLrpPl4P16x9sNAAUR
  33. tCNBbmR5IEogUm9iYiA8QUpSb2JiQHBhdmlsaW9uLmNvLnVrPrQhQW5keSBSb2Ji
  34. IDxBSlJvYmJAcGF2aWxpb24uY28udWs+
  35. =/wVD
  36. -----END PGP PUBLIC KEY BLOCK-----
  37.  
  38.